package com.xiyi.shouxin.entity.user.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;

import com.xiyi.shouxin.entity.user.RankData;

public class RankDataMapper implements RowMapper<RankData> {
    @Override
    @Nullable
    public RankData mapRow(@Nullable ResultSet rs, int rowNum) throws SQLException {
        RankData data = new RankData();
        if (rs == null) {
            return data;
        }
        data.setUid(rs.getLong("uid"));
        data.setQualifiedQuantity(rs.getInt("qualified_quantity"));
        data.setMaxTotal(rs.getInt("max_total"));
        data.setTotal(rs.getInt("total"));
        data.setPassRate(rs.getDouble("pass_rate"));
        return data;
    }
}
